// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_QU_ITEM
// * CreateDate    : 2014-06-05 18:30:37
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:37
// * LastChanger   : 2014-06-05 18:30:37
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class SalesQuItemEntity : EntityBase
    {
        public SalesQuItemTable TableSchema
        {
            get
            {
                return SalesQuItemTable.Current;
            }
		}
		
		public SalesQuItemEntity()
        {

        }
		
		public SalesQuItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.QuId = Convert.ToString(CommonFunctions.ToObject(dr["QU_ID"]));
			this.QuNo = Convert.ToString(CommonFunctions.ToObject(dr["QU_NO"]));
			this.ContactUser = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_USER"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.ProductSpec = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.MaxPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MAX_PRICE"]));
			this.MinPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MIN_PRICE"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
			this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
			this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }
		
		public SalesQuItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.QuId = Convert.ToString(CommonFunctions.ToObject(dr["QU_ID"]));
			this.QuNo = Convert.ToString(CommonFunctions.ToObject(dr["QU_NO"]));
			this.ContactUser = Convert.ToString(CommonFunctions.ToObject(dr["CONTACT_USER"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.ProductSpec = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.IsTax = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_TAX"]));
			this.SubTotal = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUB_TOTAL"]));
			this.MaxPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MAX_PRICE"]));
			this.MinPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MIN_PRICE"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
			this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
			this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SalesQuItemTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_ID)); }
            set { SetData(SalesQuItemTable.C_ID, value); }
        }
		
        [DataMember]
        public string QuId
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_QU_ID)); }
            set { SetData(SalesQuItemTable.C_QU_ID, value); }
        }
		
        [DataMember]
        public string QuNo
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_QU_NO)); }
            set { SetData(SalesQuItemTable.C_QU_NO, value); }
        }
		
        [DataMember]
        public string ContactUser
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_CONTACT_USER)); }
            set { SetData(SalesQuItemTable.C_CONTACT_USER, value); }
        }
		
        [DataMember]
        public string MaterialId
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_MATERIAL_ID)); }
            set { SetData(SalesQuItemTable.C_MATERIAL_ID, value); }
        }
		
        [DataMember]
        public string MaterialName
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_MATERIAL_NAME)); }
            set { SetData(SalesQuItemTable.C_MATERIAL_NAME, value); }
        }
		
        [DataMember]
        public string MaterialCode
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_MATERIAL_CODE)); }
            set { SetData(SalesQuItemTable.C_MATERIAL_CODE, value); }
        }
		
        [DataMember]
        public string ProductSpec
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_PRODUCT_SPEC)); }
            set { SetData(SalesQuItemTable.C_PRODUCT_SPEC, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_QTY)); }
            set { SetData(SalesQuItemTable.C_QTY, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_UNIT)); }
            set { SetData(SalesQuItemTable.C_UNIT, value); }
        }
		
        [DataMember]
        public decimal Price
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_PRICE)); }
            set { SetData(SalesQuItemTable.C_PRICE, value); }
        }
		
        [DataMember]
        public decimal TaxRate
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_TAX_RATE)); }
            set { SetData(SalesQuItemTable.C_TAX_RATE, value); }
        }
		
        [DataMember]
        public int IsTax
        {
            get { return Convert.ToInt32(GetData(SalesQuItemTable.C_IS_TAX)); }
            set { SetData(SalesQuItemTable.C_IS_TAX, value); }
        }
		
        [DataMember]
        public decimal SubTotal
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_SUB_TOTAL)); }
            set { SetData(SalesQuItemTable.C_SUB_TOTAL, value); }
        }
		
        [DataMember]
        public decimal MaxPrice
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_MAX_PRICE)); }
            set { SetData(SalesQuItemTable.C_MAX_PRICE, value); }
        }
		
        [DataMember]
        public decimal MinPrice
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_MIN_PRICE)); }
            set { SetData(SalesQuItemTable.C_MIN_PRICE, value); }
        }
		
        [DataMember]
        public string Material
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_MATERIAL)); }
            set { SetData(SalesQuItemTable.C_MATERIAL, value); }
        }
		
        [DataMember]
        public decimal DiameterOut
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_DIAMETER_OUT)); }
            set { SetData(SalesQuItemTable.C_DIAMETER_OUT, value); }
        }
		
        [DataMember]
        public decimal DiameterIn
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_DIAMETER_IN)); }
            set { SetData(SalesQuItemTable.C_DIAMETER_IN, value); }
        }
		
        [DataMember]
        public decimal Length
        {
            get { return Convert.ToDecimal(GetData(SalesQuItemTable.C_LENGTH)); }
            set { SetData(SalesQuItemTable.C_LENGTH, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(SalesQuItemTable.C_REMARK)); }
            set { SetData(SalesQuItemTable.C_REMARK, value); }
        }
		
		#endregion
	}
	
	
}	

